package com.cloud.tio.tiocloud.models;

import lombok.Data;

@Data
public class Result<T> {
    private boolean success;
    private String code;
    private String msg;
    private T data;

    public Result<T> success(T t) {
        Result<T> result = new Result<T>();
        result.code = "200";
        result.success = true;
        result.data = t;
        return result;

    }

    public Result<T> fail(T t) {
        Result<T> result = new Result<T>();
        result.code = "500";
        result.success = false;
        result.data = t;
        return result;

    }
}
